home *** CD-ROM | disk | FTP | other *** search
- { POP.PAS
- By Bela Lubkin 71016,1573
- Compile this to a .COM file and put POP.COM somewhere on your PATH. Then
- POP will return you to a directory path saved with the PUSH command.
- Requires Turbo 3.0 or greater, DOS 2.0 or greater.
- }
-
- Const
- StackFileName='C:\CDSTACK.DAT'; { Change to whatever seems appropriate }
-
- Type
- StackElement=String[66];
-
- Var
- S: StackElement;
- StackFile: File Of StackElement;
- I: Integer;
-
- Begin
- Assign(StackFile,StackFileName);
- {$I-} Reset(StackFile); {$I+}
- If IOResult<>0 Then
- Begin
- WriteLn('Stack empty');
- Halt;
- End;
- Seek(StackFile,FileSize(StackFile)-1);
- Read(StackFile,S);
- Seek(StackFile,FileSize(StackFile)-1);
- Truncate(StackFile);
- I:=FileSize(StackFile);
- Close(StackFile);
- If I=0 Then Erase(StackFile);
- ChDir(S);
- End.
-
-